<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>浮动练习</title>
    <style>
        body{margin: 0}
        ul,li,a{
            margin: 0;
            padding: 0;
            list-style: none;
        }
        ul{
            width: 100%;
            height: 40px;
            background-color: skyblue;
        }
        ul>li>a{
            text-align: center;
            line-height: 40px;
            color: white;
            cursor: pointer;
            width: 10%;
            height: 40px;
            /*左浮动 元素会脱离文档流占位,后面的元素挤压上来,父级高度为0(高度坍塌)*/
            /*第一种解决方案:给父元素高度*/
            /*第二种解决方案:*/
            float: left;
            list-style: none;
            text-decoration: none;
        }
        a:hover{
            color: darkblue;
        }
    </style>
</head>
<body>
<ul>
    <li><a href="" target="_blank">首页</a></li>
    <li><a href="" target="_blank">免费课</a></li>
    <li><a href="" target="_blank">直播课</a></li>
    <li><a href="" target="_blank">精品课</a></li>
    <li><a href="" target="_blank">线上班(VIP)</a></li>
    <li><a href="" target="_blank">线下班</a></li>
    <li><a href="" target="_blank">大内高手</a></li>
    <li><a href="" target="_blank">高校专区</a></li>
    <li><a href="" target="_blank">T-GPT</a></li>
    <li><a href="" target="_blank">我的课程</a></li>
</ul>
</body>
</html>